package com.asen.commons.core.base.enums;

import com.asen.commons.core.base.IntegerEnum;
import com.asen.commons.core.base.ObjectEnum;
import com.asen.commons.core.base.StringEnum;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 字段类型
 *
 * @author Gary
 * @version 1.0
 * @date 2018-11-10
 */
public enum JdbcTypeEnum implements ObjectEnum<Class> {

    /**
     * 字符串
     */
    STRING(String.class, "VARCHAR"),

    BOOLEAN(Boolean.class, "TINYINT"),

    INTEGER(Integer.class, "INTEGER"),

    LONG(Long.class, "BIGINT"),

    DECIMAL(BigDecimal.class, "DECIMAL"),

    DATETIME(Date.class, "DATETIME"),

    STRING_ENUM(StringEnum.class, "VARCHAR"),

    INTEGER_ENUM(IntegerEnum.class, "INTEGER");

    private Class key;

    private String desc;

    private JdbcTypeEnum(Class key, String desc) {
        this.key = key;
        this.desc = desc;
    }

    @Override
    public Class getValue() {
        return key;
    }

    @Override
    public String getDesc() {
        return desc;
    }

}
